﻿using System;

using NUnit.Framework;
using System.Xml;

namespace Yawf.Core.Xml {
	[TestFixture]
	public class XmlDsigUtilsTest {
		[Test]
		public void TestValidateSignature() {
			XmlDocument xmlDoc;

			xmlDoc = XmlUtils.ReadXmlDocument(AppDomain.CurrentDomain.BaseDirectory + "/Resources/ValidateXML.xml");
			Assert.IsTrue(XmlDsigUtils.ValidateSignature(xmlDoc),"Firma no es valida");

			xmlDoc = XmlUtils.ReadXmlDocument(AppDomain.CurrentDomain.BaseDirectory + "/Resources/ErrorValidate.xml");
			Assert.IsFalse(XmlDsigUtils.ValidateSignature(xmlDoc),"Firma es valida aunque no debe serlo");
		}
	}
}
